package com.vector.demo.service.impl;

import com.vector.demo.mapper.ClassMapper;
import com.vector.demo.pojo.Class;
import com.vector.demo.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class ClassServiceImpl implements ClassService {

    @Autowired
    private ClassMapper classMapper;

    @Override
    public List<Class> selectClass() {
        return classMapper.selectAllClass();
    }

    @Override
    @Transactional
    public Class addClass(Class aclass) {
        return classMapper.addClass(aclass);
    }

    @Override
    @Transactional
    public void dropClassById(int cla_id) {
        classMapper.dropClassById(cla_id);
    }

    @Override
    public Class preModifyClass(int cla_id) {
        return classMapper.preModifyClass(cla_id);
    }

    @Override
    @Transactional
    public void modifyClass(Class aclass) {
        classMapper.modifyClass(aclass);
    }

    @Override
    public int numberClass(int id) {
        return classMapper.numberClass(id);
    }

}
